package StudyCode.summary.mycollection;

import java.util.Collection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ConvertCollectionStringToStringArray {
	public static void main(String[] argv) {
		Collection c = java.util.Arrays.asList("科技与人文", "www.tah1986.com");
		System.out.println(java.util.Arrays.toString(convert(c)));
	}

	public static String[] convert(Collection<String> c) {
		if (c == null)
			return null;

		String[] r = new String[c.size()];
		int i = 0;
		for (String s : c) {
			r[i] = s;
			i++;
		}
		return r;
	}

}
